﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WR.BL.BE;
using WR.DL.DALC.SAP;

namespace WR.BL.BCC
{
    public class ClientBC
    {
        private string _connId = string.Empty;

        #region Singleton
        public static ClientBC getInstance(string pConnId)
        {
            if (_instance == null)
            {
                lock (typeof(ClientBC))
                {
                    if (_instance == null)
                    {
                        _instance = new ClientBC(pConnId);
                    }
                }
            }
            return _instance;
        }
        private ClientBC(string pConnId) { this._connId = pConnId; }
        private static volatile ClientBC _instance = null;
        #endregion

        public string cliEventual(string pCod)
        {
            return ClientDALC.getInstance(this._connId).cliEventual(pCod);
        }

        public ClientBE read(string pCod)
        {
            return ClientDALC.getInstance(this._connId).read(pCod);
        }

        public List<ClientBE> find(string pCod, string pDesc)
        {
            return ClientDALC.getInstance(this._connId).find(pCod, pDesc, string.Empty);
        }

        public List<ClientBE> list()
        {
            return ClientDALC.getInstance(this._connId).find(string.Empty, string.Empty, string.Empty);
        }
    }
}
